<?php
/**
 * Created by Zhy
 * User: Zhy
 * Date: 2019/11/12
 * Time: 17:00
 */

namespace app\index\controller;


use think\Db;

class Other extends Base
{
    /**
     * 顾问团
     * @return mixed
     */
    public function guWen(){
        $detail = Db::table('up_other')->where('other_id', 1)->field('other_content')->find();
        $this->assign('detail', $detail);
        return $this->fetch('other/guwen');
    }
    
    /**
     * 机构团队介绍
     * @return mixed
     */
    public function jiGou(){
        $detail = Db::table('up_other')->where('other_id', 2)->field('other_content')->find();
        $this->assign('detail', $detail);
        return $this->fetch('other/jigou');
    }
    
    /**
     * 联盟介绍
     * @return mixed
     */
    public function lianM(){
        $detail = Db::table('up_other')->where('other_id', 3)->field('other_content')->find();
        $this->assign('detail', $detail);
        return $this->fetch('other/lianm');
    }
    
    /**
     * 发起单位
     * @return mixed
     */
    public function company(){
        $detail = Db::table('up_other')->where('other_id', 4)->field('other_content')->find();
        $this->assign('detail', $detail);
        return $this->fetch('other/company');
    }
    
    /**
     * 自训历史
     * @return mixed
     */
    public function history(){
        $detail = Db::table('up_other')->where('other_id', 5)->field('other_content')->find();
        $this->assign('detail', $detail);
        return $this->fetch('other/history');
    }
    
    /**
     * 自训案例
     * @return mixed
     */
    public function anL(){
        $detail = Db::table('up_other')->where('other_id', 6)->field('other_content')->find();
        $this->assign('detail', $detail);
        return $this->fetch('other/anl');
    }
    
    /**
     * 联盟成立大会
     * @return mixed
     */
    public function bigMeet(){
        $detail = Db::table('up_other')->where('other_id', 7)->field('other_content')->find();
        $this->assign('detail', $detail);
        return $this->fetch('other/bigmeet');
    }
    
    /**
     * 贡献榜
     * @return mixed
     */
    public function gongX(){
        $detail = Db::table('up_other')->where('other_id', 8)->field('other_content')->find();
        $this->assign('detail', $detail);
        return $this->fetch('other/gongx');
    }
    
    /**
     * 联系我们
     * @return mixed
     */
    public function contactUs(){
        $detail = Db::table('up_other')->where('other_id', 10)->field('other_content')->find();
        $this->assign('detail', $detail);
        return $this->fetch('other/contactus');
    }
    
    /**
     * 意见反馈
     * @return \think\response\Json
     */
    public function sendFeedback(){
        $params = input('param.');
        $insert = [
            'feedback_content' => $params['feedback_content'],
            'feedback_user_name' => $params['feedback_user_name'],
            'feedback_time' => date('Y-m-d H:i:s')
        ];
        $res = Db::table('up_feedback')->insert($insert);
        if($res){
            return json(['status' => 200, 'msg' => '反馈成功']);
        }else{
            return json(['status' => 0, 'msg' => '反馈失败']);
        }
    }
    
    /**
     * 响哨APP
     * @return mixed
     */
    public function xiangShao(){
        $detail = Db::table('up_other')->where('other_id', 9)->field('other_content')->find();
        $this->assign('detail', $detail);
        return $this->fetch('other/xiangshao');
    }
    
    /**
     * 社团列表
     * @return mixed
     */
    public function mass(){
        return $this->fetch('other/mass');
    }
}